package file.model;

import file.exception.FileException;

import javax.swing.*;
import java.awt.*;

/**
 * 文件区域
 * @Author: zou
 * @email: 704572528@qq.com
 * @Date: 2020/10/30 11:13
 */
public class FilePannelModel {

    /**
     * 图片区域
     */
    private Panel imagePannel;

    /**
     * 文件区域
     */
    private Panel textPannel;

    /**
     * 隐藏区域
     */
    private JLabel hiddleLable;

    /**
     * 文件名
     */
    private JLabel fileNameLable;

    /**
     * 路径名
     */
    private JLabel pathNameLable;


    private FileModel fileModel;


    /**
     * 获取 路径 + 名称的 C：\222
     * @return
     */
    public String getFullName () {

        if (fileModel == null) {
            throw new FileException("fileModel为空！");
        }
        if (!fileModel.getFolder()) {
            throw new FileException("这个不是文件夹！");
        }
        return pathNameLable.getText() +"\\"+ fileNameLable.getText();
    }

    public JLabel getFileNameLable() {
        return fileNameLable;
    }

    public void setFileNameLable(JLabel fileNameLable) {
        this.fileNameLable = fileNameLable;
    }

    public JLabel getPathNameLable() {
        return pathNameLable;
    }

    public void setPathNameLable(JLabel pathNameLable) {
        this.pathNameLable = pathNameLable;
    }

    public FileModel getFileModel() {
        return fileModel;
    }

    public void setFileModel(FileModel fileModel) {
        this.fileModel = fileModel;
    }

    public JLabel getHiddleLable() {
        return hiddleLable;
    }

    public void setHiddleLable(JLabel hiddleLable) {
        this.hiddleLable = hiddleLable;
    }

    public Panel getImagePannel() {
        return imagePannel;
    }

    public void setImagePannel(Panel imagePannel) {
        this.imagePannel = imagePannel;
    }

    public Panel getTextPannel() {
        return textPannel;
    }

    public void setTextPannel(Panel textPannel) {
        this.textPannel = textPannel;
    }
}
